package com.predict.javademo.controller;

import com.predict.javademo.services.AutoEvaService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@CrossOrigin(origins = "*", allowedHeaders = "*", methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.OPTIONS})
@RequiredArgsConstructor
public class RootController {

    private final AutoEvaService autoEvaService;

    @PostMapping("/aotu_eva")
    public ResponseEntity<?> aotuEva(@RequestBody Map<String, Object> requestBody) {
        return autoEvaService.handleAutoEva(requestBody);
    }
    
//    @PostMapping("/auto_eva")
//    public ResponseEntity<?> autoEva(@RequestBody Map<String, Object> requestBody) {
//        return autoEvaService.handleAutoEva(requestBody);
//    }
}